# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>

_realname=yelp-xsl
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=3.36.0
pkgrel=1
pkgdesc="Stylesheets for Yelp (mingw-w64)"
arch=('any')
license=('GPL')
url="https://www.gnome.org"
options=('strip' '!libtool' 'staticlibs')
makedepends=("intltool"
             "${MINGW_PACKAGE_PREFIX}-itstool"
             "${MINGW_PACKAGE_PREFIX}-libxml2" 
             "${MINGW_PACKAGE_PREFIX}-libxslt"
             "${MINGW_PACKAGE_PREFIX}-python-mallard-ducktype")
source=(https://download.gnome.org/sources/${_realname}/${pkgver:0:4}/${_realname}-${pkgver}.tar.xz)
sha256sums=('4fe51c0233b79a4c204c68498d45f09b342c30ed02c4e418506c0e35f0904ec3')

prepare() {
  cd ${srcdir}/${_realname}-${pkgver}
  autoreconf -ivf
}

build() {
  [[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf "${srcdir}"/build-${CARCH}
  mkdir -p "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH}
  PYTHON=${MINGW_PREFIX}/bin/python3 \
  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --target=${MINGW_CHOST} \
    --sysconfdir=${MINGW_PREFIX}/etc \
    --localstatedir=${MINGW_PREFIX}/var \
    --enable-doc 

  make
}

check() {
  cd ${srcdir}/build-${CARCH}
  make -k check
}

package() {
  cd ${srcdir}/build-${CARCH}
  make DESTDIR="${pkgdir}" install
  mkdir -p ${pkgdir}${MINGW_PREFIX}/lib
  mv ${pkgdir}${MINGW_PREFIX}/share/pkgconfig ${pkgdir}${MINGW_PREFIX}/lib/
}
